Name

ibgetconf — Get names of boards and devices configured in gpib.conf

Synopsis

#include <gpib/ib.h>
int ibgetconf(dev_array[]); 
struct dev_entry * dev_array[];
 

Description

The *dev_array[] parameter is pointer that receives the returned array of struct dev_entry items. For each interface and device configured in the gpib.conf configuration file, the dev_array[].type field is set to 1 for an interface and to 0 for a device. The corresponding dev_array[].name is set to the string of the name of the interface or device. All the device entries following an interface entry belong the that interface, i.e. they refer to the minor of the immediately preceding interface entry. The interface entries are set in the order of appearance in gpib.conf.

Return value

The number of names set in dev_array is returned. If a parsing error occurs -1 is returned and iberr and ibcnt are set accordingly.

Example program

#include <stdio.h>
#include <gpib/ib.h>

int main() {
  int i,n;
  struct dev_entry *dev_arr;
  n = ibgetconf(&dev_arr);
  printf("got %i entries\n",n);
  for (i=0; i<n; i++) {
    printf("%i %s\n", dev_arr[i].type, dev_arr[i].name);
  }
}